package com.lixl.concurrent;

public class ThreadDemo {

	public static void main(String[] args) {
		for (int i = 0; i < 5; i++) {
			new Thread(new LiftOff()).start();
		}
		System.out.println("all start");
	}

}

class LiftOff implements Runnable{

	@Override
	public void run() {
		for (int i = 0; i < 3; i++) {
			System.out.println(Thread.currentThread().getName()+"("+i+")");
			Thread.yield();//会使运行中的线程让出时间片
		}
		
	}
	
}
